package com.llly.client;

import com.llly.client.impl.ProductFeignClientImpl;
import com.llly.pojo.Easybuy_product;
import com.llly.pojo.Easybuy_product_category;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Component
@FeignClient(name = "provider9091",fallback = ProductFeignClientImpl.class)
public interface ProductFeignClient {


    @RequestMapping("/showType")
    public List<Easybuy_product_category> findAllEpcs();

    @RequestMapping("/findProductByPid")
    public Easybuy_product findProductByPid(@RequestParam Integer pid);

    //直接查询1/2/3级分类下商品
    @RequestMapping("/selectEpsByEpcId")
    public List<Easybuy_product> selectEpsByEpcId(@RequestParam  Integer id);

    @RequestMapping("/findAllprosByEpc")
    public List<Easybuy_product> findAllprosByEpc(@RequestParam  Integer epcId);

    @RequestMapping("/findpname")
    public Easybuy_product_category findpname(@RequestParam Integer id);

    @RequestMapping("/showProduct")
    public List<Easybuy_product> showProduct(@RequestParam String epname);
    //显示一级分类
    @RequestMapping("/ShowAllOne")
    public List<Easybuy_product_category> ShowAllOne();
    //根据一级分类显示二级分类
    @RequestMapping("/ShowAllTwo")
    public List<Easybuy_product_category> ShowAllTwo(@RequestParam Integer parentId);
    //根据二级分类显示三级分类
    @RequestMapping("/ShowAllThree")
    public List<Easybuy_product_category> ShowAllThree(@RequestParam Integer parentId);
    //商品上架
    @RequestMapping("/addeasybuy")
    public int addeasybuy(@RequestBody Easybuy_product easybuy_product);
}
